home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / std / c++ / 560 < prev    next >
Encoding:
Text File  |  1996-08-06  |  2.2 KB  |  59 lines

  1. Path: engnews1.Eng.Sun.COM!taumet!clamage
  2. From: James Kanze US/ESC 60/3/141 #40763 <kanze@lts.sel.alcatel.de>
  3. Newsgroups: comp.std.c++
  4. Subject: Re: Q: default constructor for fundamental types?
  5. Date: 27 Feb 1996 16:01:12 GMT
  6. Organization: ?
  7. Approved: clamage@eng.sun.com (comp.std.c++)
  8. Message-ID: <9602271131.AA18225@lts.sel.alcatel.de>
  9. References: <4glrdc$dqo@ra.ibr.cs.tu-bs.de> <4gsvhn$csi@clarknet.clark.net>
  10. NNTP-Posting-Host: taumet.eng.sun.com
  11. Content-Type: text
  12. In-Reply-To: gusty@clark.net's message of 26 Feb 1996 20:13:44 GMT
  13. Content-Length: 1310
  14. X-Lines: 34
  15. Originator: clamage@taumet
  16.  
  17. In article <4gsvhn$csi@clarknet.clark.net> gusty@clark.net (Harlan
  18. Messinger) writes:
  19.  
  20. |> Dirk Herrmann (dirk@sallust.ida.ing.tu-bs.de) wrote:
  21. |> : Sorry if this has been discussed before.
  22. |> : 
  23. |> : When using templates, it appears that there should be
  24. |> : default constructors for the fundamental data types.
  25.  
  26. |> Essentially, there is.
  27.  
  28.     [Example deleted...]
  29.  
  30. |> But it appears that it is allowed. It works fine in Visual C++ 2.2. 
  31.     [...]
  32.  
  33. |> The following produces output of "8" on the first line and gobbledygook 
  34. |> on the second line, since the effect of the "default constructor" of the 
  35. |> integer member function is to do nothing.
  36.  
  37. This is wrong, but since it is a recent change, it is probable that
  38. the compiler simply hasn't implemented it yet.
  39.  
  40. Expressions of the form `int()' have always been allowed.  A (fairly)
  41. recent change to the draft standard states that they have the same
  42. value as default static initialization (in this case, 0).  The earlier
  43. rules had the initailization undefined.
  44.  
  45. --
  46. James Kanze         Tel.: (+33) 88 14 49 00        email: kanze@gabi-soft.fr
  47. GABI Software, Sarl., 8 rue des Francs-Bourgeois, F-67000 Strasbourg, France
  48. Conseils, Θtudes et rΘalisations en logiciel orientΘ objet --
  49.                 -- A la recherche d'une activitΘ dans une region francophone
  50.  
  51.  
  52.  
  53. [ comp.std.c++ is moderated.  To submit articles: Try just posting with your
  54.                 newsreader.  If that fails, use mailto:std-c++@ncar.ucar.edu
  55.   comp.std.c++ FAQ: http://reality.sgi.com/austern/std-c++/faq.html
  56.   Moderation policy: http://reality.sgi.com/austern/std-c++/policy.html
  57.   Comments? mailto:std-c++-request@ncar.ucar.edu
  58. ]
  59.